// 在这里面定义所有接口，一个文件管理所有接口，易于维护
import {
  http
} from './http'; // 引入刚刚封装好的http模块，import属于ES6的语法，微信开发者工具必须打开ES6转ES5选项

// 外卖 左侧导航
function typeList(postData, doSuccess, doFail, doComplete) {
  http('/type/list', 'post', postData, doSuccess, doFail, doComplete)
}
// 外卖 下单
function orderAdd(postData, doSuccess, doFail, doComplete) {
  http('/order/save', 'post', postData, doSuccess, doFail, doComplete)
}
// 查询商品
function commodityList(postData, doSuccess, doFail, doComplete) {
  http('/commodity/list', 'post', postData, doSuccess, doFail, doComplete)
}
// 新增商品
function commoditySave(postData, doSuccess, doFail, doComplete) {
  http('/commodity/save', 'post', postData, doSuccess, doFail, doComplete)
}
// 修改商品
function commodityUpdateById(postData, doSuccess, doFail, doComplete) {
  http('/commodity/updateById', 'post', postData, doSuccess, doFail, doComplete)
}
// 删除商品
function commodityDel(postData, doSuccess, doFail, doComplete) {
  http('/commodity/del', 'post', postData, doSuccess, doFail, doComplete)
}


export default { // 暴露接口
  typeList,
  commodityList,
  orderAdd,
  commoditySave,
  commodityUpdateById,
  commodityDel
}